%
% modified version of http://matlabgeeks.com/tips-tutorials/how-to-do-a-fourier-transform-in-matlab/
%
%

function [y]= freqDomainPlot(sound)
%Filename that you want to load
file = sound
%y is the array of bytes, Fs is the sampling frequency, bits is the bit rate
[y,Fs,bits] = wavread(file);

%length of the array
Nsamps = length(y);

%Do Fourier Transform
y_fft = abs(fft(y));            %Retain Magnitude
f = Fs*(0:Nsamps-1)/Nsamps;   %Prepare freq data for plot

%Plot Sound File in Frequency Domain
figure
plot(f, y_fft)
xlim([0 1000])
xlabel('Frequency (Hz)')
ylabel('Amplitude')
title('Frequencies of sample')